package com.itheima.edu.info.manager.day9;

import java.util.*;
import java.util.function.BiConsumer;

public class SetBianLi {
    public static void main(String[] args) {

        TreeSet<Student1> ts = new TreeSet<>();
        Student1 sd = new Student1("王五", 806, 80, 80);
        Student1 sd1 = new Student1("王五", 707, 70, 70);
        Student1 sd2 = new Student1("王五", 90, 90, 90);
        Student1 sd3 = new Student1("王五", 100, 100, 100);
        Student1 sd4 = new Student1("王五", 100, 100, 100);
        ts.add(sd);
        ts.add(sd1);
        ts.add(sd2);
        ts.add(sd3);
        System.out.println(sd.sum + "sum");
        for (Student1 t : ts) {
            System.out.println(t);
        }
        HashSet<Student1> hs = new HashSet<>();
        hs.add(sd);
        hs.add(sd1);
        hs.add(sd2);
        hs.add(sd3);
        hs.add(sd4);
        System.out.println(hs);
        HashMap<String, String> hm = new HashMap();
        hm.put("wc", "mnb");
        hm.put("wcn", "mnb");
        hm.put("wcnm", "mnb");
        int size = hm.size();
        System.out.println(size);
        boolean empty = hm.isEmpty();
        System.out.println(empty);
        String wc1 = hm.remove("wc");
        System.out.println(wc1);
        hm.put("wcnmb", "mnb");
        boolean wc = hm.containsKey("wc");
        System.out.println(wc);
        System.out.println(hm);
        System.out.println("---------------");
        HashMap<Integer, Integer> hmp = new HashMap<>();
        hmp.put(1, 998);
        hmp.put(2, 997);
        hmp.put(3, 996);
        hmp.put(4, 95);
        hmp.put(5, 994);
        hmp.put(6, 993);
        hmp.put(7, 990);
        hmp.put(8, 992);
        hmp.put(9, 991);
        hmp.put(10, 9900);
        hmp.put(11, 998);
        hmp.put(12, 999);
        hmp.put(13, 9977);
        Set<Map.Entry<Integer, Integer>> entries = hmp.entrySet();

        for (Map.Entry<Integer, Integer> entry1 : entries) {
            System.out.println(entry1.getKey() + "----" + entry1.getValue());
        }
        System.out.println("-------------------");
        Set<Integer> integers = hmp.keySet();
        for (Integer integer : integers) {
            System.out.println(integer + "--" + hmp.get(integer));
        }
        System.out.println("11111111111111111111111111111111111111111111");
        for (Integer integer : integers) {
            System.out.println(integer + "--- " + hmp.get(integer));
            System.out.println("-----------------------------------");

        }
        hmp.forEach((Integer integer1, Integer integer2) -> {
            System.out.println(integer1 + "--" + integer2);
        });

    }
}
